<h2>Site Search Indexes</h2>
<?php
$indexes = DigSearch_Service_Index::listIndexes();
if($indexes) {
?>
<p>You currently have the following indexes defined:</p>
<ul id="search_indexes">
    <?php foreach (array_keys($indexes) as $index) {?>
        <li>
            <?= $index ?> [<a href="/digSearch/index/build" rel="<?= $index ?>">rebuild</a>]
            <?= $this->htmlList(DigSearch_Service_Index::getIndexCategories($index));?>
        </li>
    <?php } ?>
</ul>
<?php } else { ?>
<p>You do not have any search indexes defined</p>
<?php } ?>
<?php $this->jQuery()->onLoadCaptureStart(); ?>
$('#search_indexes a').click(function(){
    $.dig.ui.message.add('Building index...please be patient, this may take some time!');
    $.post('/digSearch/index/build', {index: $(this).attr('rel')}, function(response) {
        $.dig.ui.message.clear();
        $.dig.ui.message.add(response);
    }, 'json');
    return false;
});
<?php $this->jQuery()->onLoadCaptureEnd(); ?>


